﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
	font-family: Geneva, Arial, Helvetica, sans-serif;
}
-->
</style>
</head>

<body>
<h3><a name="Enums"></a>Enum Data Types</h3>
              <p>One of the values you can specify for the <code>&lt;UserPref&gt;</code> <code>datatype</code> attribute
                  is <code>enum</code>. The <code>enum</code> data
                  type is presented in the user interface as a menu of
                  choices. You specify the contents of the menu using <code>&lt;EnumValue&gt;</code>.</p>

              <p>For example, this <code>&lt;UserPref&gt;</code> lets
                  users set the level of difficulty for a game. Each value
                  that will appear in the menu (Easy, Medium, and Hard)
                  is defined using an <code>&lt;EnumValue&gt;</code> tag. </p>
              <pre>&lt;UserPref name="difficulty" 
     display_name="Difficulty"
     datatype="enum"
     default_value="4"&gt;
  &lt;EnumValue value="3" display_value="Easy"/&gt;
  &lt;EnumValue value="4" display_value="Medium"/&gt;

  &lt;EnumValue value="5" display_value="Hard"/&gt;
&lt;/UserPref&gt;</pre>
              <p>The following table lists the <code>&lt;EnumValue&gt;</code> attributes:</p>
              <table>

                  <tbody><tr>
                      <th>Attribute</th>

                      <th>Description</th>
                  </tr>
                  <tr>
                      <td><code>value </code></td>
                      <td>Required string that provides a unique value.
                          This value is displayed in the menu in the user
                          preferences edit box unless a <code>display_value</code> is
                          provided. </td>
                  </tr>

                  <tr>
                      <td><code>display_value </code></td>
                      <td>Optional string that is displayed in the menu
                          in the user preferences edit box. If you do not
                          specify a <code>display_value</code>,
                          the <code>value</code> is
                          displayed in the user interface.</td>
</body>
</html>
